
class Student {

}

class Teacher {

}

class School {
    private Student[] students;
    private Teacher[] teachers;

    public Student[] getStudents() {
        return students;
    }

    public void setStudents(Student[] students) {
        this.students = students;
    }

    public Teacher[] getTeachers() {
        return teachers;
    }

    public void setTeachers(Teacher[] teachers) {
        this.teachers = teachers;
    }
}

class People extends School {


    public void func() {
        System.out.println(super.getStudents());
    }
}
public class TestPart {
    /**
     * 继承和组合:类之间的关系,可以实现代码复用
     * @param args
     *  将一个类的实例作为另外一个类的字段
     *  一般使用继承还是组合根据情况而定,但是能用组合就用组合
     */
    public static void main(String[] args) {
        People people = new People();
        people.func();
    }
}
